home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / midipeek.zip / PEEK.TXT < prev   
Text File  |  1988-09-04  |  7KB  |  170 lines

  1. -MIDIPEEK-
  2.  
  3. MidiPeek is a greatly expanded and improved version of my program
  4. Peek, which first appeared in the February 1986 issue of Keyboard
  5. magazine.
  6.  
  7. MidiPeek is a monitor for the Roland MPU-401 MIDI interface,
  8. and equivalents (including the Voyetra OP-4001 and the Music
  9. Quest MCC).  It displays MIDI activity on the computer screen.
  10. MidiPeek has these features:
  11.  
  12.   - displays in hexadecimal, decimal, or English format.
  13.   - filters of types of MIDI messages.
  14.   - 32K buffer
  15.   - can save of buffer contents to a diskfile
  16.   - can send diskfile data over MIDI
  17.  
  18. MidiPeek can be used just by typing   midipeek   at a DOS prompt.
  19. The program will ask you some terse but (I hope) self-explanatory
  20. questions.  If you need further guidance, or are curious about
  21. MIDI internals, you may want to read the following topics.
  22.  
  23.  
  24. ----------------------------------------------------------------
  25.  
  26. -What's in the MIDI data stream?-
  27.  
  28. MIDI messages consist of status bytes and data bytes.  The status
  29. bytes tell what kind of data is coming next; the data bytes
  30. following (usually one or two in number) are that data.  Status
  31. bytes always have their high bit set -- that is, their value is
  32. equal to or greater than 128 decimal, $80 hexadecimal.  Data
  33. bytes are always less than 128 decimal, $80 hex.
  34.  
  35. Here follows a list of MIDI status bytes, with their definitions,
  36. given in hexadecimal notation, e.g. $8n -- where $ indicates
  37. hexadecimal, 8 is the type of status byte, and n is the MIDI
  38. channel.
  39.  
  40. The types of message (defined by status bytes) are these:
  41.  
  42.    - $8n.  Note-off. 2 data bytes follow.  The first byte is
  43.      the MIDI note number, the second is its off velocity.
  44.      Equipment that generates genuine note-off messages is rare.
  45.      Usually a "note-off" actually generates a "note-on" message
  46.      with velocity of zero.
  47.  
  48.    - $9n.  Note-on.  2 data bytes follow.  First is note number,
  49.      second velocity.
  50.  
  51.    - $An.  Polyphonic key pressure.  2 data bytes follow.  First
  52.      is note number, second is pressure data.  (Rare.)
  53.  
  54.    - $Bn.  Continuous controller.  2 data bytes follow.  First is
  55.      controller number, second is controller data.  There are
  56.      many continuous controllers defined in the MIDI spec,
  57.      including sustain pedal, modulation wheel, MIDI volume
  58.      control, data sliders, and much more.  Consult a recent
  59.      version of the MIDI specification for details.
  60.  
  61.    - $Cn.  Program (patch) change.  1 data byte follows,
  62.      specifying which of 128 possible patches will be selected.
  63.  
  64.    - $Dn.  Aftertouch.  1 data byte follows, giving the
  65.      instantaneous value of pressure on the keyboard.  (Not all
  66.      devices send this.)
  67.  
  68.    - $En.  Pitch wheel.  2 data bytes follow.  First is the least
  69.      significant byte of the data, second is the most significant
  70.      byte.  In practice, although they send and receive both
  71.      bytes, most synthesizers ignore the first, least significant
  72.      byte.
  73.  
  74.    - $Fn.  System messages.  A variety of little-used messages
  75.      lurk under this heading.  The "n" of $Fn in this case does
  76.      not indicate the MIDI channel -- are system messages are
  77.      sent and received to all equipment regardless of channel
  78.      setting.  See the MIDI spec for further details.  $F0 is the
  79.      most important system message, that being "system
  80.      exclusive", the mechanism whereby remote data dumps and
  81.      parameter changes are performed.
  82.  
  83. -Display formats-
  84.  
  85. The bulk of the MidiPeek screen is given over to displaying data.
  86. It does so in three formats: hexadecimal, decimal, and "English".
  87. Hexadecimal is base-16, beloved of computer persons and some spec
  88. sheets.  Decimal is normal base ten.  "English" translates status
  89. bytes into their definitions as given above, and puts every
  90. message on its own line; this format is much the easiest to read,
  91. but suffers in terms of efficient use of screen space.  (Data may
  92. scroll off before you want it to). "English" is also somewhat
  93. slower than the other formats, and may lose some data when
  94. pressed (e.g. by system-exclusive or continuous controllers).
  95.  
  96. In any format, status bytes are always highlighted.
  97.  
  98. -Filtering-
  99.  
  100. MidiPeek lets you strip whole classes of data from the
  101. display (and files).  This can make the display much more
  102. legible.  For example, wind and guitar controllers generate a
  103. great deal of continuous controller data; if you only want to
  104. view their note-ons, you'd do well to filter the other stuff.
  105.  
  106. -Save to Disk-
  107.  
  108. MidiPeek saves the last 32,000 MIDI data bytes in its buffer,
  109. even after they've scrolled off the screen.  When you're done
  110. viewing MIDI data, you can save the entire buffer to a disk file
  111. if you like.  MidiPeek will always ask you for a filename to save
  112. to; if you don't want to save, just hit Return.
  113.  
  114. This is useful for two reasons.  1) If you want to view a long
  115. session later, outside of the screen constraints of MidiPeek, you
  116. can.  MidiPeek saves MIDI data in binary format, not text format,
  117. so you'll need a binary file viewer.  Vernon Buerg's shareware
  118. LIST program (use the Alt-H option) is highly recommended for
  119. this purpose. 2) It can be used, in conjunction with MidiPeek's
  120. "send" function, as a crude generic librarian for system-
  121. exclusive data.  You can dump a patch, or a bank, to MidiPeek,
  122. save it to disk, and then later restore it using "send".  (Note:
  123. it's possible to overrun MidiPeek's capacities in terms of speed
  124. and storage.  This function is an added "goodie", not an
  125. intrinsic, robust part of the program.  It works with my
  126. equipment, but may or may not work on yours.  And it won't work
  127. on equipment that plays handshaking tricks with system-exclusive,
  128. such as the Casio CZ series.  A reliable generic librarian,
  129. MidiSave, is available from Carter Scholz for $15.)
  130.  
  131. -Send-
  132.  
  133. Reciprocates the "save" function, by sending out everything in a
  134. specified disk file over MIDI.  No timing information is stored;
  135. it all goes out at speed.  That is, if there are note-ons in the
  136. file, they'll all sound at once.
  137.  
  138.  
  139. -----------------------------------------
  140.  
  141. --MINIPEEK--
  142.  
  143. MiniPeek is a stripped-down version of MidiPeek.  It's a smaller
  144. file, and it runs faster.  It doesn't allow filtering, or
  145. selection of display format: everything is displayed in hex.  It
  146. doesn't allow saves or sends.  Its advantage is that it asks no
  147. questions -- if you just want a quick, raw, hex display of all
  148. MIDI data, you may want to use this.
  149.  
  150. --MPU.PAS--
  151.  
  152. This file contains the primitives for the MPU-401.  Note that no
  153. checking is done for the MPU's presence in this version.  If your
  154. system doesn't have this MIDI interface connected when you run
  155. either PEEK, your computer will hang.
  156.  
  157. --REGISTRATION--
  158.  
  159. The $15 shareware fee entitles you to upgrades, printed docs, and
  160. so forth.
  161.  
  162. ------------------------------------------
  163.  
  164. Carter Scholz
  165. 2665 Virginia St.
  166. Berkeley CA 94709
  167.  
  168.   ...{hplabs/dual/glacier/seismo/lll-crg}!well!csz
  169.   well!csz@ucbvax.berkeley.edu
  170.